package spring.bean;

import javax.annotation.Resource;

public class Student extends Person {

    private Teacher headTeacher;
    private int grade;

    @Resource
    public void setHeadTeacher(Teacher headTeacher) {
        this.headTeacher = headTeacher;
    }

    public int getGrade() {
        return grade;
    }

    public void setGrade(int grade) {
        this.grade = grade;
    }

    @Override
    public void say(String name) {
        headTeacher.say(name);
    }

    public void init() {
        System.out.println("student init");
    }

    public void destroy() {
        System.out.println("student destroy");
    }
}
